package com.rzn.reading.utils;


import com.rzn.reading.dto.PageParams;
import com.rzn.reading.dto.Pageable;


public class PageUtil {
    public static PageParams getPageParams(Pageable pageInfo) {
        PageParams pageParams = new PageParams();
        pageParams.setPageSize(pageInfo.getPageSize());
        pageParams.setOffset((pageInfo.getPage() - 1) * pageInfo.getPageSize());
        return pageParams;
    }
}
